package com.itheima.Service.Impl;

import com.itheima.Dao.Impl.StudentDaoImpl;
import com.itheima.Dao.StudentDao;
import com.itheima.Service.StudentService;
import com.itheima.domain.Student;

;

import java.util.List;

public class StudentServiceImpl implements StudentService {

    private StudentDao dao = new StudentDaoImpl();


    @Override
    public void add(Student stu) {
        dao.insert(stu);
    }

    @Override
    public void delete(String sid) {
        dao.delete(sid);
    }

    @Override
    public void update(Student newStu) {
        dao.update(newStu);
    }

    @Override
    public List<Student> findAll() {

        return dao.selectAll();
    }

    @Override
    public List<Student> findByCondition(String age, String score) {
        return dao.selectByCondition(age,score);
    }


}
